<?php
/**
* @package Pages-and-Items (com_pi_pages_and_items)
* @version 1.4.0
* @copyright Copyright (C) 2006-2009 Carsten Engel. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* @author http://www.joomlapi.com
* @joomla Joomla is Free Software
*/

//no direct access
if(!defined('_VALID_MOS') && !defined('_JEXEC')){
	die('Restricted access');
}


//get data from database (when edit) or config (when new)
if($sub_task=='edit'){

	//check page access rights	
	if(!$class_pi->check_page_access($pageId)){
		echo '<script> alert(\''._pi_lang_no_edit_page.'\'); window.history.go(-1); </script>';
		exit();
	}
	
	foreach($class_pi->menuitems as $row){
		if($row->id==$pageId){
			$menutype = $row->menutype;					
			$pageName = $row->name;			
			$pageLink = $row->link;
			if( defined('_JEXEC') ){
				//joomla 1.5
				$alias = $row->alias;
			}
			$pageType = $row->type;					
			$pageInMenu = $row->published;
			$pageParent = $row->parent;
			$pageComponentId = $row->componentid;
			$pageOrdering = $row->ordering;
			$pageBrowserNav = $row->browserNav;
			if( defined('_JEXEC') ){
				//joomla 1.5
				$default_home = $row->home;
			}
			
			//get menu access, for different Joomla versions from different columns
			if( defined('_JEXEC') ){
				//joomla 1.5
				$pageUtAccess = $row->access;
			}else{
				//joomla 1.0.x
				$pageUtAccess = $row->utaccess;
			}			
			$pageParams = $row->params;
			break;
		}
	}
	$parameters = $pageParams;//################ i need to sort this
	
	//if content category blog get category_id and see if it is published and see if user got workflow rights to edit
	if((strstr($pageLink, 'index.php?option=com_content&view=category&layout=blog') && $pageType!='url') || $pageType=='content_blog_category'){
		//get category id
		if(defined('_JEXEC')){
			//joomla 1.5			
			$cat_id = str_replace('index.php?option=com_content&view=category&layout=blog&id=','',$row->link);
		}else{
			//joomla 1.0.x
			$cat_id = $pageComponentId;
		}
		
		//get category published data and sectionid
		$class_pi->db->setQuery("SELECT id, published, access, section FROM #__categories WHERE id='$cat_id' LIMIT 1");
		$rows = $class_pi->db->loadObjectList();
		$row = $rows[0];
		$categoryPublished = $row->published;
		$access_category = $row->access;
		$section_id = $row->section;
		
		//check section access
		if(!$class_pi->check_section_access($section_id)){
			echo "<script> alert('"._pi_lang_nosectionaccess."'); window.history.go(-1); </script>";
			exit();
		}
		
		//check edit-page rights	
		if(!$class_pi->checkUserActionRight(3)){
			echo "<script> alert('"._pi_lang_noeditpage."'); window.history.go(-1); </script>";
			exit();
		}
	}else{
		//check edit-page-link rights	
		if(!$class_pi->checkUserActionRight(4)){
			echo "<script> alert('"._pi_lang_noeditpagelink."'); window.history.go(-1); </script>";
			exit();
		}
	}
	
	
	
	?>
		<script language="javascript" type="text/javascript">
			function submitbutton(pressbutton) {
				if (pressbutton == 'cancel') {
					submitform( pressbutton );
					return;
				}
				if (pressbutton == 'page_move_select') {
					document.location.href = 'index2.php?option=com_pi_pages_and_items&task=page_move_select&pageId='+<?php echo $pageId; ?>;
					return;
				}				
				if (pressbutton == 'page_trash') {	
					are_you_sure = '<?php echo _pi_lang_confirm_page_trash; ?>';					
					if(confirm(are_you_sure)){						
						submitform('page_trash');		
					}				
				}	
				if (pressbutton == 'page_save') {	
					if ( document.adminForm.titleShort.value == '' ) {						
						alert( '<?php echo _pi_lang_need_title; ?>' );
						return;
					} else {
						document.getElementById('subsub_task').value = 'save';
						submitform(pressbutton);						
					}
				}
				if (pressbutton == 'page_apply') {	
					if ( document.adminForm.titleShort.value == '' ) {						
						alert( '<?php echo _pi_lang_need_title; ?>' );
						return;
					} else {
						document.getElementById('subsub_task').value = 'apply';
						submitform('page_save');						
					}
				}				
			}
			
			function new_item(page_id){
				itemtype = document.getElementById('select_itemtype').value;
				document.location.href='index2.php?option=com_pi_pages_and_items&type=content_blog_category&task=item&sub_task=new&pageId='+page_id+'&item_type='+itemtype;
			}			
		</script>
	<?php
		
//end page is editted	
}else{
//start page is new
	
	$menutype = $class_pi->get_var('menutype');	
	if($class_pi->pi_config['inherit_from_parent']){
		//find the section id of the parent, for section_id inheritance.
		
		$parent_cat_id = 0;
		//get parents cat id
		foreach($class_pi->menuitems as $menuitem){
			if($menuitem->id==$pageId){
				if(defined('_JEXEC')){
					//joomla 1.5			
					$parent_cat_id = str_replace('index.php?option=com_content&view=category&layout=blog&id=','',$menuitem->link);
				}else{
					//joomla 1.0.x
					$parent_cat_id = $menuitem->componentid;
				}
				break;
			}
		}
		
		//get sectionid
		$class_pi->db->setQuery("SELECT section FROM #__categories WHERE id='$parent_cat_id' LIMIT 1");
		$rows = $class_pi->db->loadObjectList();
		if(count($rows)){
			$row = $rows[0];		
			$section_id = $row->section;
		}else{
			$section_id = 0;
		}
	}else{
		$section_id = $class_pi->pi_config['default_section_id'];	
	}
	
	$pageType = $class_pi->get_var('type', '' );
	
	//check user right to make a new page (only with pi_admin_user_access)
	if($pageType=='content_blog_category'){
		if($class_pi->checkUserActionRight(1)!=true){
			echo '<script> alert(\''._pi_lang_no_new_page.'\'); window.history.go(-1); </script>';
			exit();	
		}
	}else if($pageType=='url'){
		//link-page
		if($class_pi->checkUserActionRight(2)!=true){
			echo '<script> alert(\''._pi_lang_no_new_link.'\'); window.history.go(-1); </script>';
			exit();	
		}
	}else{
		echo '<script> alert(\'pagetype not defined\'); window.history.go(-1); </script>';
		exit();	
	}
	
	
	$pageBrowserNav = '';
	$categoryPublished = $class_pi->pi_config['page_new_publish_category'];	
	//$categoryPublished = true;	
	$pageParent = $pageId;
	$pageLink = '';
	$pageInMenu = $class_pi->pi_config['page_new_publish_menu'];				
	$pageUtAccess = $class_pi->pi_config['page_new_access_menu'];
	$access_category = $class_pi->pi_config['page_new_access_category'];
	$default_home = 0;
	$pageParams = $class_pi->pi_config['page_new_attribs'];
	$parameters = '';	
	$cat_id = '';
	$pageComponentId = '';
	
	
	?>
		<script language="javascript" type="text/javascript">
			function submitbutton(pressbutton){
				if (pressbutton == 'cancel') {
					submitform( pressbutton );
					return;
				}				
				if (pressbutton == 'page_save') {	
					if ( document.adminForm.titleShort.value == '' ) {						
						alert( '<?php echo _pi_lang_need_title; ?>' );
						return;
					} else {
						document.getElementById('subsub_task').value = 'save';
						submitform(pressbutton);						
					}
				}
				if (pressbutton == 'page_apply') {	
					if ( document.adminForm.titleShort.value == '' ) {						
						alert( '<?php echo _pi_lang_need_title; ?>' );
						return;
					} else {
						document.getElementById('subsub_task').value = 'apply';
						submitform('page_save');						
					}
				}	
			}
		</script>
	<?php
}//end page is new
			
//explode array params
$pageParams = explode( "\n", $pageParams);

for($n = 0; $n < count($pageParams); $n++){
	//list($var,$value) = split('=',$pageParams[$n]); 
	//$values[$var] = trim($value);
	//$values[$var] = htmlspecialchars($values[$var]);	
	
	$values_temp = explode('=',$pageParams[$n]); 
	$var = $values_temp[0];
	
	//$value = trim($values_temp[1]);
	$value = str_replace($var.'=','',$pageParams[$n]);
	$value = trim($value);
	$value = htmlspecialchars($value);
	$values[$var] = $value;
}



//check if this is a normal content page
$content_page = false;
if(defined('_JEXEC')){
	//joomla 1.5
	if((strstr($pageLink, 'index.php?option=com_content&view=category&layout=blog') && $pageType!='url') || $pageType=='content_blog_category'){
		$content_page = true;
		$pageType = 'component';
		$pageComponentId = 20;
	}	
}else{
	//joomla 1.0.x
	if($pageType=='content_blog_category'){
		$content_page = true;
	}
}

//give headers in Joomla 1.5 a bit more spunk
$class_pi->spunk_up_headers_1_5();

?>

<table cellspacing="0" cellpadding="0" border="0" width="100%">
  <tr>
    <td valign="top" width="25%"><?php
		$class_pi->pages();		
		?></td> 
    <td valign="top">
	<form name="adminForm" method="post" action="">
		<input type="hidden" name="option" id="option" value="com_pi_pages_and_items" />
		<input type="hidden" name="task" value="" />
		<input type="hidden" name="sub_task" value="<?php echo $sub_task; ?>" />
		<input type="hidden" name="subsub_task" id="subsub_task" value="" />
		<input type="hidden" name="pageType" value="<?php echo $pageType; ?>" />
		<input type="hidden" name="content_page" value="<?php echo $content_page; ?>" />
		<input type="hidden" name="pageId" value="<?php echo $pageId; ?>">
		<input type="hidden" name="pageParent" value="<?php echo $pageParent; ?>">
		<input type="hidden" name="pageComponentId" value="<?php echo $pageComponentId; ?>">
		<!--<input type="hidden" name="pageUtAccess" value="0">	-->
		<input type="hidden" name="mosmsg" value="">
		<input type="hidden" name="menutype" value="<?php echo $menutype; ?>">
		<input type="hidden" name="cat_id" value="<?php echo $cat_id;?>">
		<input type="hidden" name="section_id_current" value="<?php echo $section_id;?>">
		<input type="hidden" name="default_home_current" value="<?php echo $default_home;?>">		
		<?php if($sub_task=='edit'){ ?>
			
				<table cellspacing="0" cellpadding="0" border="0" width="100%">
				  <tr>
					<td valign="top" width="49%"><table class="adminform" width="98%">
						<tr>
							<th><?php echo _pi_lang_underlying_pages; ?></th>
						</tr>
						<tr>
						<td>
						<?php
						$class_pi->underlyingPages();
						?>
						</td>
						</tr>
						</table> 		
						</td> 
						<td width="2%">&nbsp;</td>
					<td valign="top" width="49%">
					<?php if($content_page){ ?>	
					<table class="adminform" width="98%">
						<tr>
							<th>
								<?php echo _pi_lang_items_on_page; ?>
							</th>
						</tr>
						<tr>
						<td>
						<?php
						$class_pi->items($values['orderby_sec']);
						?>
						</td>
						</tr>
						</table>
						<?php } ?>		
						</td>
				  </tr>
			</table>
		
	<?php } ?>  
   <table class="adminform" width="98%">
		<tr>
			<th>
			 <?php if($sub_task=='new'){echo _pi_lang_new_page;}else{echo _pi_lang_page_properties;} if(!$content_page){echo ' ('._pi_lang_link.')';} ?>
			</th>
		</tr>
		<tr>
		<td>
		
		
		<table border="0" cellspacing="0" cellpadding="0" class="paramlist" width="98%">
		<tr>
			<td colspan="2" style="line-height: 3px; height: 3px;">&nbsp;
				
			</td>			
		</tr>
<?php 

	if($content_page){ 	

?>
		 <tr <?php if(!$class_pi->check_display_page_property('page_props_publish',133)){echo 'class="display_none"'; } ?>>
    <td>		
	<span class="editlinktip" onMouseOver="return overlib('<?php echo _pi_lang_publish2_tip; ?>', CAPTION, '<?php echo _pi_lang_publish2; ?>', BELOW, RIGHT);" onMouseOut="return nd();"><?php echo _pi_lang_publish2; ?></span></td>
    <td><label onclick="document.getElementById('show_in_menu0').disabled=true;document.getElementById('show_in_menu1').disabled=true;document.getElementById('access').disabled=true;"><input type="radio" class="radio" name="categoryPublished" id="categoryPublished0" value="0" <?php if($categoryPublished=='0'){echo "checked=\"checked\"";} ?>  /><?php echo _pi_lang_no; ?></label><label onclick="document.getElementById('show_in_menu0').disabled=false;document.getElementById('show_in_menu1').disabled=false;if(document.getElementById('show_in_menu1').checked==true){document.getElementById('access').disabled=false;}"> <input type="radio" class="radio" name="categoryPublished" id="categoryPublished1" value="1"  <?php if($categoryPublished=='1'){echo "checked=\"checked\"";} ?>  /><?php echo _pi_lang_yes; ?></label>
	<?php
	
	//give warning when user has no rights to publish
	if($class_pi->checkUserActionRight(5)!=true){
		echo '&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: red;">'._pi_lang_no_publish_page.'</span>';
	}	
	
	?>
	</td>
  </tr> 
  <tr <?php if(!$class_pi->check_display_page_property('page_props_section',134)){echo 'class="display_none"'; } ?>>
  <td>
  	<?php echo _pi_lang_section; ?>
  </td>
  <td>
  	<?php	
	
		if($class_pi->pi_config['sections_from_db']){
			$class_pi->db->setQuery("SELECT id, title "
			."FROM #__sections "		
			."ORDER BY ordering ASC"
			);
			$rows = $class_pi->db->loadObjectList();
			echo '<select name="section">';
			foreach($rows as $row){
				if($class_pi->check_section_access($row->id)){	
					echo '<option value="'.$row->id.'"';
					if($section_id==$row->id){
						echo ' selected="selected"';
					}
					echo '>'.$row->title.'</option>';
				}	
			}
			echo '</select>';
		}else{		
			//show sections as ticked in config			
			$temp_sections = explode(',',$class_pi->pi_config['sections']);	
			if($temp_sections==0){
				echo '<input type="hidden" name="section" value="'.$section_id.'" />';
				echo '<span style="color: red;">'._pi_lang_nosections.'</span>';
			}else{
				echo '<select name="section">';
				for($n = 0; $n < count($temp_sections); $n++){					
					$temp_section = explode(';',$temp_sections[$n]);
					$temp_section_id = $temp_section[0];
					$temp_section_name = $temp_section[1];			
					if($class_pi->check_section_access($temp_section_id)){	
						echo '<option value="'.$temp_section_id.'"';
						if($section_id==$temp_section_id){
							echo ' selected="selected"';
						}
						echo '>'.$temp_section_name.'</option>';	
					}		
				}
				echo '</select>';
			}		
		}
		
	?>  
  </td>
  </tr>
<?php 
	}//end if content page
?>		
		
  <tr>
    <td>
	<span class="editlinktip" onMouseOver="return overlib('<?php echo _pi_lang_title_short_tip; ?>', CAPTION, '<?php echo _pi_lang_title_short; ?>', BELOW, RIGHT);" onMouseOut="return nd();"><?php echo _pi_lang_title_short; ?></span>: <img src="components/com_pi_pages_and_items/images/star.gif" alt="required field" /></td>
    <td><input name="titleShort" type="text" id="titleShort" maxlength="100"  class="text_area" value="<?php if($sub_task=='edit'){echo (htmlspecialchars($pageName));} ?>" /></td>
  </tr>
  
<?php if($content_page){ 

	//rename attributes for joomla 1.5
	if( defined('_JEXEC') ){
		//joomla 1.5
		$leading = 'num_leading_articles';
		$intro = 'num_intro_articles';	
		$columns = 'num_columns';
		$link = 'num_links';	
		$pagination = 'show_pagination';
		$pagination_results = 'show_pagination_results';	
		$description = 'show_description';
		$description_image = 'show_description_image';
		$category = 'show_category';
		$category_link = 'link_category';	
		$readmore = 'show_readmore';
		$rating = 'show_vote';
		$author = 'show_author';
		$createdate = 'show_create_date';
		$modifydate = 'show_modify_date';
		$pdf = 'show_pdf_icon';
		$print = 'show_print_icon';
		$email = 'show_email_icon';
		$header = 'page_title';
		$show_title = 'show_page_title';
		$show_readmore = 'show_readmore';		
		$section = 'show_section';
		$section_link = 'link_section';			
	}else{
		//joomla 1.0.x
		$leading = 'leading';
		$intro = 'intro';
		$columns = 'columns';
		$link = 'link';
		$pagination = 'pagination';	
		$pagination_results = 'pagination_results';	
		$description = 'description';
		$description_image = 'description_image';
		$category = 'category';
		$category_link = 'category_link';	
		$readmore = 'readmore';
		$rating = 'rating';
		$author = 'author';
		$createdate = 'createdate';
		$modifydate = 'modifydate';
		$pdf = 'pdf';
		$print = 'print';
		$email = 'email';
		$header = 'header';
		$show_title = 'page_title';
		$show_readmore = 'readmore';		
		$section = 'section';
		$section_link = 'section_link';			
	}	

if(defined('_JEXEC')){
	//joomla 1.5
	//use alias only on Joomla 1.5, 1.0.x did not have alias for categories and menu's.

?>
 <tr <?php if(!$class_pi->check_display_page_property('page_props_alias',173)){echo 'class="display_none"'; } ?>>
<td width="30%" ><?php echo ucfirst(_pi_lang_alias); ?>
</td>

<td><input type="text" name="alias" value="<?php echo isset($alias)? $alias : ''; ?>" class="text_area" /></td>
</tr>
<?php
}
?>
  <tr <?php if(!$class_pi->check_display_page_property('page_props_title',135)){echo 'class="display_none"'; } ?>>
<td width="30%" ><span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_page_title_tip; ?>', CAPTION, '<?php echo _pi_lang_page_title; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_page_title; ?></span>
</span></td>

<td><input type="text" name="params[<?php echo $header; ?>]" value="<?php echo isset($values[$header])? $values[$header] : ''; ?>" class="text_area" style="width: 300px;" /></td>
</tr>


  <tr <?php if(!$class_pi->check_display_page_property('page_props_title_visible',136)){echo 'class="display_none"'; } ?>>
<td width="30%" ><span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_title_visible_tip; ?>', CAPTION, '<?php echo _pi_lang_title_visible; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_title_visible; ?></span>
</span></td>
<td>
	<label><input type="radio" class="radio" name="params[<?php echo $show_title; ?>]" value="0" <?php if($values[$show_title]==0){ echo "checked=\"checked\""; }?> /><?php echo _pi_lang_no; ?></label><label> <input type="radio" class="radio" name="params[<?php echo $show_title; ?>]"  value="1" <?php if($values[$show_title]==1){ echo "checked=\"checked\""; }?> /><?php echo _pi_lang_yes; ?></label>
	

</td>
</tr>


 
  
<?php 
	}//end if content page
?>  
   <tr>
	<td colspan="2" class="hr">&nbsp;
		
	</td>
</tr>

  <tr <?php if(!$class_pi->check_display_page_property('page_props_show_in_menu',137)){echo 'class="display_none"'; } ?>>
    <td>	
	<span class="editlinktip" onMouseOver="return overlib('<?php echo _pi_lang_show_in_menu_tip; ?>', CAPTION, '<?php echo _pi_lang_show_in_menu; ?>', BELOW, RIGHT);" onMouseOut="return nd();"><?php echo _pi_lang_show_in_menu; ?></span></td>
    <td><label onclick="document.getElementById('access').disabled=true;"><input type="radio" class="radio" name="show_in_menu" id="show_in_menu0" value="0" <?php if($pageInMenu==0){echo "checked=\"checked\"";} ?> /><?php echo _pi_lang_no; ?> </label><label onclick="document.getElementById('access').disabled=false;"><input type="radio" class="radio" name="show_in_menu" id="show_in_menu1" value="1" <?php if($pageInMenu==1){echo "checked=\"checked\"";} ?> /><?php echo _pi_lang_yes; ?></label>&nbsp;&nbsp;
	<select name="access" id="access" class="inputbox" <?php if($pageInMenu==0){echo "disabled=\"true\"";} ?>>
		<option value="0" <?php if($pageUtAccess=='0'){echo "selected=\"selected\"";} ?>><?php echo _pi_lang_public; ?></option>
		<option value="1" <?php if($pageUtAccess=='1'){echo "selected=\"selected\"";} ?>><?php echo _pi_lang_logged; ?></option>
		<option value="2" <?php if($pageUtAccess=='2'){echo "selected=\"selected\"";} ?>><?php echo _pi_lang_special; ?></option>	
	</select>	
	</td>
  </tr>
  <?php
  if($content_page){ 
  ?>
  <tr <?php if(!$class_pi->check_display_page_property('page_props_access',138)){echo 'class="display_none"'; } ?>>
    <td>
	<span class="editlinktip" onMouseOver="return overlib('<?php echo _pi_lang_access_tip; ?>', CAPTION, '<?php echo _pi_lang_access; ?>', BELOW, RIGHT);" onMouseOut="return nd();"><?php echo _pi_lang_access; ?></span>
	</td>
    <td><select name="access_category" class="inputbox">
	<option value="0" <?php if($access_category==0){echo "selected=\"selected\"";} ?>><?php echo _pi_lang_public; ?></option>
	<option value="1" <?php if($access_category==1){echo "selected=\"selected\"";} ?>><?php echo _pi_lang_logged; ?></option>
	<option value="2" <?php if($access_category==2){echo "selected=\"selected\"";} ?>><?php echo _pi_lang_special; ?></option>	
</select></td>
  </tr> 
  <?php
  }//end category blog
  
  //set default homepage only in joomla 1.5
  if(defined('_JEXEC')){
  	//joomla 1.5
  ?> 
	<tr <?php if(!$class_pi->check_display_page_property('page_props_defaulthome',139)){echo 'class="display_none"'; } ?>>
		<td>
			<span class="editlinktip" onMouseOver="return overlib('<?php echo _pi_lang_defaulthome_tip; ?>', CAPTION, '<?php echo _pi_lang_defaulthome; ?>', BELOW, RIGHT);" onMouseOut="return nd();"><?php echo _pi_lang_defaulthome; ?></span>			
		</td>
		<td>
			<input type="checkbox" name="default_home" value="1" <?php if($default_home==1){echo 'checked="checked"';} ?> />
			<?php if($default_home==1){echo '<span class="warning">'._pi_lang_do_not_delete_default_page.'</span>';} ?>			
		</td>
	</tr>
	<?php
	}//end set default homepage only in joomla 1.5
	?>
<tr>
	<td colspan="2" class="hr">&nbsp;
		
	</td>
</tr>
<?php if(!$content_page){ ?>
<script language="JavaScript" type="text/javascript">
	<!--
	function popupPageBrowser(url){
		var winl = (screen.width - 400) / 2;
		var wint = (screen.height - 400) / 2;
		winprops = 'height=400,width=400,top='+wint+',left='+winl+',scrollbars=yes,resizable';
		linkValue = document.getElementById('link').value;
		linkValue = escape(linkValue);
		urlString = url+'&url='+linkValue;
		win = window.open(urlString, 'pages', winprops);
		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
	}
	-->
</script>
 <tr>
    <td valign="top">
	<span class="editlinktip" onMouseOver="return overlib('<?php echo _pi_lang_link_tip; ?>', CAPTION, '<?php echo _pi_lang_link; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_link; ?></span>
	
	</td>
    <td><input name="link" id="link" type="text" style="width: 300px;" class="text_area" value="<?php if($sub_task=='edit'){echo $pageLink;} ?>" /><br />
<br />

<input type="button" value="<?php echo _pi_lang_select_page_link; ?>" onclick="popupPageBrowser('index2.php?option=com_pi_pages_and_items&task=page_browser_popup&pageId=<?php echo $pageId;?>');" />
	<br></td>
  </tr>
  <tr>
    <td valign="top">
	<span class="editlinktip" onMouseOver="return overlib('<?php echo _pi_lang_open_page_tip; ?>', CAPTION, '<?php echo _pi_lang_open_page; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_open_page; ?></span>	
	</td>
    <td>
			<select name="browserNav" id="browserNav" class="inputbox" size="4">
			<option value="0" <?php if($pageBrowserNav==0){echo "selected=\"selected\"";} ?>><?php echo _pi_lang_same_window; ?></option>
			<option value="1" <?php if($pageBrowserNav==1){echo "selected=\"selected\"";} ?>><?php echo _pi_lang_new_window; ?></option>
			<option value="2" <?php if($pageBrowserNav==2){echo "selected=\"selected\"";} ?>><?php echo _pi_lang_new_without_nav; ?></option>
		</select>
</td>
  </tr>
  <tr>
  <td valign="top"><?php echo _pi_lang_parameters; ?>
  </td>
   <td>  
   
   <textarea name="parameters" cols="30" rows="10" ><?php echo $parameters; ?></textarea>
  </td>
  </tr>
  
<?php }else{ ?>
<input name="link" type="hidden" value="<?php echo $pageLink; ?>" />
<?php } ?>


<?php if($content_page){ ?>
<?php if( !defined('_JEXEC') ){ 
		//back-button only in joomla 1.0.x
?>

<tr>
<td width="30%" ><span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_back_tip; ?>', CAPTION, '<?php echo _pi_lang_back; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_back; ?></span>
</span></td>
<td>
<select name="params[back_button]" class="inputbox">
	<option value="" <?php if($values['back_button']==''){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_default; ?></option>
	<option value="0" <?php if($values['back_button']=='0'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_no; ?></option>
	<option value="1" <?php if($values['back_button']=='1'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_yes; ?></option>
</select>
</td>
</tr>

<?php } //end if backbutton only for joomla 1.0.x 

?>

<tr <?php if(!$class_pi->check_display_page_property('page_props_leading',140)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_leading_tip; ?>', CAPTION, '<?php echo _pi_lang_leading; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_leading; ?></span></span></td>
<td><input type="text" name="params[<?php echo $leading; ?>]" value="<?php print_r($values[$leading]); ?>" class="text_area" size="3"/></td>
</tr>
<tr <?php if(!$class_pi->check_display_page_property('page_props_nr_intro',141)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_nr_intro_tip; ?>', CAPTION, '<?php echo _pi_lang_nr_intro; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_nr_intro; ?></span></span>
</td>
<td><input type="text" name="params[<?php echo $intro; ?>]" value="<?php print_r($values[$intro]); ?>" class="text_area" size="3"/></td>
</tr>
<tr <?php if(!$class_pi->check_display_page_property('page_props_columns',142)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_columns_tip; ?>', CAPTION, '<?php echo _pi_lang_columns; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_columns; ?></span></span>
</td>

<td><input type="text" name="params[<?php echo $columns; ?>]" value="<?php print_r($values[$columns]); ?>" class="text_area" size="3"/></td>
</tr>
<tr <?php if(!$class_pi->check_display_page_property('page_props_nr_links',143)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip"> 
<span onMouseOver="return overlib('<?php echo _pi_lang_nr_links_tip; ?>', CAPTION, '<?php echo _pi_lang_nr_links; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_nr_links; ?></span></span>
</td>
<td><input type="text" name="params[<?php echo $link; ?>]" value="<?php print_r($values[$link]); ?>" class="text_area" size="3"/></td>
</tr>
<tr <?php if(!$class_pi->check_display_page_property('page_props_cat_order',144)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">  
<span onMouseOver="return overlib('<?php echo _pi_lang_cat_order_tip; ?>', CAPTION, '<?php echo _pi_lang_cat_order; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_cat_order; ?></span></span>
</td>
<td>
	<select name="params[orderby_pri]" class="inputbox">
		<option value="" <?php if($values['orderby_pri']==''){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_primaryorderonly; ?></option>
		<option value="alpha" <?php if($values['orderby_pri']=='alpha'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_alphabetic_up; ?></option>
		<option value="ralpha" <?php if($values['orderby_pri']=='ralpha'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_alphabetic_down; ?></option>
		<option value="order" <?php if($values['orderby_pri']=='order'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_ordering; ?></option>
	</select>
</td>
</tr>
<tr <?php if(!$class_pi->check_display_page_property('page_props_primaryorder',145)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">  
<span onMouseOver="return overlib('<?php echo _pi_lang_primaryorder_tip; ?>', CAPTION, '<?php echo _pi_lang_primaryorder; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_primaryorder; ?></span></span>
</td>
<td>
	<select name="params[orderby_sec]" class="inputbox">
		<option value="" <?php if($values['orderby_sec']==''){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_default_cap; ?></option>
		<option value="date" <?php if($values['orderby_sec']=='date'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_oldest; ?></option>
		<option value="rdate" <?php if($values['orderby_sec']=='rdate'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_mostrecent; ?></option>
		<option value="alpha" <?php if($values['orderby_sec']=='alpha'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_alphabetic_up; ?></option>
		<option value="ralpha" <?php if($values['orderby_sec']=='ralpha'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_alphabetic_down; ?></option>
		<option value="author" <?php if($values['orderby_sec']=='author'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_alphbetic_author_up; ?></option>
		<option value="rauthor" <?php if($values['orderby_sec']=='rauthor'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_alphbetic_author_down; ?></option>
		<option value="hits" <?php if($values['orderby_sec']=='hits'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_mosthits; ?></option>
		<option value="rhits" <?php if($values['orderby_sec']=='rhits'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_leasthits; ?></option>
		<option value="order" <?php if($values['orderby_sec']=='order'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_ordering; ?></option>
	</select>
</td>
</tr>
<tr <?php if(!$class_pi->check_display_page_property('page_props_pagination',146)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip"> 
<span onMouseOver="return overlib('<?php echo _pi_lang_pagination_tip; ?>', CAPTION, '<?php echo _pi_lang_pagination; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_pagination; ?></span></span>
</td>
<td>
	<select name="params[<?php echo $pagination; ?>]" class="inputbox">
		<option value="2" <?php if($values[$pagination]==2){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_default; ?></option>
		<option value="0" <?php if($values[$pagination]==0){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_no; ?></option>
		<option value="1" <?php if($values[$pagination]==1){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_yes; ?></option>
		
	</select>
</td>
</tr>
<tr <?php if(!$class_pi->check_display_page_property('page_props_paginationresults',147)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">  
<span onMouseOver="return overlib('<?php echo _pi_lang_paginationresults_tip; ?>', CAPTION, '<?php echo _pi_lang_paginationresults; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_paginationresults; ?></span></span>

</td>
<td>
	<input type="radio" class="radio" name="params[<?php echo $pagination_results; ?>]" id="params[pagination_results]0" value="0" <?php if($values[$pagination_results]==0){ echo "checked=\"checked\""; }?> />
	<label for="params[pagination_results]0"><?php echo _pi_lang_no; ?></label>
	<input type="radio" class="radio" name="params[<?php echo $pagination_results; ?>]" id="params[pagination_results]1" value="1" <?php if($values[$pagination_results]==1){ echo "checked=\"checked\""; }?>  />
	<label for="params[pagination_results]1"><?php echo _pi_lang_yes; ?></label>
</td>
</tr>
<?php 
//options only for joomla 1.5
if( defined('_JEXEC') ){
	//joomla 1.5
?>
<tr <?php if(!$class_pi->check_display_page_property('page_props_feedlink',148)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">  
<span onMouseOver="return overlib('<?php echo _pi_lang_feedlink_tip; ?>', CAPTION, '<?php echo _pi_lang_feedlink; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_feedlink; ?></span></span>
</td>
<td>
	<input type="radio" class="radio" name="params[show_feed_link]" id="params[pagination_results]0" value="0" <?php if($values['show_feed_link']==0){ echo "checked=\"checked\""; }?> />
	<label for="params[pagination_results]0"><?php echo _pi_lang_no; ?></label>
	<input type="radio" class="radio" name="params[show_feed_link]" id="params[pagination_results]1" value="1" <?php if($values['show_feed_link']==1){ echo "checked=\"checked\""; }?>  />
	<label for="params[pagination_results]1"><?php echo _pi_lang_yes; ?></label>
</td>
</tr>

<tr <?php if(!$class_pi->check_display_page_property('page_props_shownoauth',149)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip"> 
<span onMouseOver="return overlib('<?php echo _pi_lang_shownoauth_tip; ?>', CAPTION, '<?php echo _pi_lang_shownoauth; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_shownoauth; ?></span></span>
</td>
<td>
	<select name="params[show_noauth]" class="inputbox">
		<option value="2" <?php if($values['show_noauth']==2){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_default; ?></option>
		<option value="0" <?php if($values['show_noauth']==0){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_no; ?></option>
		<option value="1" <?php if($values['show_noauth']==1){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_yes; ?></option>
		
	</select>
</td>
</tr>

<?php 
}//end if options only for joomla 1.5
?>
<?php 
//mosimage option only for joomla 1.0.x
if( !defined('_JEXEC') ){
	//joomla 1.0.x
?>
<tr>
<td width="30%">
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_mosimages_tip; ?>', CAPTION, '<?php echo _pi_lang_mosimages; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_mosimages; ?></span></span>
</td>
<td>
	<input type="radio" class="radio" name="params[image]" id="params[image]0" value="0" <?php if($values['image']==0){ echo "checked=\"checked\""; }?> />
	<label for="params[image]0"><?php echo _pi_lang_no; ?></label>
	<input type="radio" class="radio" name="params[image]" id="params[image]1" value="1" <?php if($values['image']==1){ echo "checked=\"checked\""; }?> />
	<label for="params[image]1"><?php echo _pi_lang_yes; ?></label>
</td>
</tr>
<?php 
}//end if joomla 1.0.x for mosimages option 
?>

<tr <?php if(!$class_pi->check_display_page_property('page_props_categorydescription',150)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_categorydescription_tip; ?>', CAPTION, '<?php echo _pi_lang_categorydescription; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_categorydescription; ?></span></span>
</td>
<td>
	<input type="radio" class="radio" name="params[<?php echo $description; ?>]" id="params[description]0" value="0" <?php if($values[$description]==0){ echo "checked=\"checked\""; }?>  />
	<label for="params[description]0"><?php echo _pi_lang_no; ?></label>
	<input type="radio" class="radio" name="params[<?php echo $description; ?>]" id="params[description]1" value="1"  <?php if($values[$description]==1){ echo "checked=\"checked\""; }?> />
	<label for="params[description]1"><?php echo _pi_lang_yes; ?></label>

</td>
</tr>
<tr <?php if(!$class_pi->check_display_page_property('page_props_categorydescriptionimage',151)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_categorydescriptionimage_tip; ?>', CAPTION, '<?php echo _pi_lang_categorydescriptionimage; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_categorydescriptionimage; ?></span></span>
</td>
<td>
	<input type="radio" class="radio" name="params[<?php echo $description_image; ?>]" id="params[description_image]0" value="0" <?php if($values[$description_image]==0){ echo "checked=\"checked\""; }?>  />
	<label for="params[description_image]0"><?php echo _pi_lang_no; ?></label>
	<input type="radio" class="radio" name="params[<?php echo $description_image; ?>]" id="params[description_image]1" value="1" <?php if($values[$description_image]==1){ echo "checked=\"checked\""; }?> />
	<label for="params[description_image]1"><?php echo _pi_lang_yes; ?></label>
</td>
</tr>

<tr <?php if(!$class_pi->check_display_page_property('page_props_categoryname',152)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_categoryname_tip; ?>', CAPTION, '<?php echo _pi_lang_categoryname; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_categoryname; ?></span></span>

</td>
<td>
	<input type="radio" class="radio" name="params[<?php echo $category; ?>]" id="params[category]0" value="0" <?php if($values[$category]==0){ echo "checked=\"checked\""; }?>  />
	<label for="params[category]0"><?php echo _pi_lang_no; ?></label>
	<input type="radio" class="radio" name="params[<?php echo $category; ?>]" id="params[category]1" value="1"  <?php if($values[$category]==1){ echo "checked=\"checked\""; }?> />
	<label for="params[category]1"><?php echo _pi_lang_yes; ?></label>
</td>
</tr>
<tr <?php if(!$class_pi->check_display_page_property('page_props_categorynameclickable',153)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_categorynameclickable_tip; ?>', CAPTION, '<?php echo _pi_lang_categorynameclickable; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_categorynameclickable; ?></span></span>
</td>
<td>
	<input type="radio" class="radio" name="params[<?php echo $category_link; ?>]" id="params[category_link]0" value="0" <?php if($values[$category_link]==0){ echo "checked=\"checked\""; }?>  />
	<label for="params[category_link]0"><?php echo _pi_lang_no; ?></label>
	<input type="radio" class="radio" name="params[<?php echo $category_link; ?>]" id="params[category_link]1" value="1" <?php if($values[$category_link]==1){ echo "checked=\"checked\""; }?> />
	<label for="params[category_link]1"><?php echo _pi_lang_yes; ?></label>
</td>
</tr>
<tr <?php if(!$class_pi->check_display_page_property('page_props_itemtitles',154)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_itemtitles_tip; ?>', CAPTION, '<?php echo _pi_lang_itemtitles; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_itemtitles; ?></span></span>
</td>
<td>
<?php
//radio buttons with 2 options for joomla 1.0.x . select with 3 options for joomla 1.5 (don't ask me why)
if( defined('_JEXEC') ){
	//joomla 1.5
	?>
	<select name="params[show_title]" class="inputbox">
		<option value="2" <?php if($values['show_title']==2){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_default; ?></option>
		<option value="0" <?php if($values['show_title']==0){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_no; ?></option>
		<option value="1" <?php if($values['show_title']==1){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_yes; ?></option>
		
	</select>
	<?php
}else{
	//joomla 1.0.x
	?>
	<label><input type="radio" class="radio" name="params[item_title]" value="0" <?php if($values['item_title']==0){ echo "checked=\"checked\""; }?> /><?php echo _pi_lang_no; ?></label>
	<label><input type="radio" class="radio" name="params[item_title]" value="1" <?php if($values['item_title']==1){ echo "checked=\"checked\""; }?>  /><?php echo _pi_lang_yes; ?></label>
	<?php
}
?>	
</td>
</tr>

<?php
//show introtext_option, section_name, section_name_linkable only for joomla 1.5
if( defined('_JEXEC') ){
	//joomla 1.5
	?>
<tr <?php if(!$class_pi->check_display_page_property('page_props_showintro',155)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_showintro_tip; ?>', CAPTION, '<?php echo _pi_lang_showintro; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_showintro; ?></span></span>
</td>
<td>
	<select name="params[show_intro]" class="inputbox">
		<option value="" <?php if($values['show_intro']==''){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_default; ?></option>
		<option value="0" <?php if($values['show_intro']=='0'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_no; ?></option>	
		<option value="1" <?php if($values['show_intro']=='1'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_yes; ?></option>
	</select>
</td>
</tr>

<tr <?php if(!$class_pi->check_display_page_property('page_props_section_title',156)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_section_tip; ?>', CAPTION, '<?php echo _pi_lang_section_title; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_section_title; ?></span></span>
</td>
<td>
	<select name="params[<?php echo $section; ?>]" class="inputbox">
		<option value="" <?php if($values[$section]==''){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_default; ?></option>
		<option value="0" <?php if($values[$section]=='0'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_no; ?></option>
	
		<option value="1" <?php if($values[$section]=='1'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_yes; ?></option>
	</select>
</td>
</tr>
<tr <?php if(!$class_pi->check_display_page_property('page_props_sectionlink',157)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_sectionlink_tip; ?>', CAPTION, '<?php echo _pi_lang_sectionlink; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_sectionlink; ?></span></span>
</td>
<td>
	<select name="params[<?php echo $section_link; ?>]" class="inputbox">
		<option value="" <?php if($values[$section_link]==''){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_default; ?></option>
		<option value="0" <?php if($values[$section_link]=='0'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_no; ?></option>
	
		<option value="1" <?php if($values[$section_link]=='1'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_yes; ?></option>
	</select>
</td>
</tr>
<?php
}//end if show introtext option, section, section_name_linkable only for joomla 1.5
?>

<tr <?php if(!$class_pi->check_display_page_property('page_props_linkedtitles',158)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_linkedtitles_tip; ?>', CAPTION, '<?php echo _pi_lang_linkedtitles; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_linkedtitles; ?></span></span>
</td>
<td>
	<select name="params[link_titles]" class="inputbox">
		<option value="" <?php if($values['link_titles']==''){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_default; ?></option>
		<option value="0" <?php if($values['link_titles']=='0'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_no; ?></option>
	
		<option value="1" <?php if($values['link_titles']=='1'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_yes; ?></option>
	</select>
</td>
</tr>
<tr <?php if(!$class_pi->check_display_page_property('page_props_readmore',159)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_readmore_tip; ?>', CAPTION, '<?php echo _pi_lang_readmore; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_readmore; ?></span></span>
</td>
<td>
	<select name="params[<?php echo $readmore; ?>]" class="inputbox">
		<option value="" <?php if($values[$readmore]==''){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_default; ?></option>
		<option value="0" <?php if($values[$readmore]=='0'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_no; ?></option>
	
		<option value="1" <?php if($values[$readmore]=='1'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_yes; ?></option>
	</select>
</td>
</tr>
<tr <?php if(!$class_pi->check_display_page_property('page_props_itemrating',160)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_itemrating_tip; ?>', CAPTION, '<?php echo _pi_lang_itemrating; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_itemrating; ?></span></span>
</td>
<td>
<select name="params[<?php echo $rating; ?>]" class="inputbox">
	<option value="" <?php if($values[$rating]==''){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_default; ?></option>
	<option value="0" <?php if($values[$rating]=='0'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_no; ?></option>

	<option value="1"<?php if($values[$rating]=='1'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_yes; ?></option>
</select>
</td>
</tr>
<tr <?php if(!$class_pi->check_display_page_property('page_props_authornames',161)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_authornames_tip; ?>', CAPTION, '<?php echo _pi_lang_authornames; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_authornames; ?></span></span>
</td>
<td>
<select name="params[<?php echo $author; ?>]" class="inputbox">
	<option value="" <?php if($values[$author]==''){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_default; ?></option>
	<option value="0" <?php if($values[$author]=='0'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_no; ?></option>

	<option value="1" <?php if($values[$author]=='1'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_yes; ?></option>
</select>
</td>
</tr>
<tr <?php if(!$class_pi->check_display_page_property('page_props_createdtimedate',162)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_createdtimedate_tip; ?>', CAPTION, '<?php echo _pi_lang_createdtimedate; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_createdtimedate; ?></span></span>
</td>
<td>
<select name="params[<?php echo $createdate; ?>]" class="inputbox">
	<option value="" <?php if($values[$createdate]==''){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_default; ?></option>
	<option value="0" <?php if($values[$createdate]=='0'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_no; ?></option>

	<option value="1" <?php if($values[$createdate]=='1'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_yes; ?></option>
</select>
</td>
</tr>
<tr <?php if(!$class_pi->check_display_page_property('page_props_modifiedtimedate',163)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_modifiedtimedate_tip; ?>', CAPTION, '<?php echo _pi_lang_modifiedtimedate; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_modifiedtimedate; ?></span></span>
</td>
<td>
<select name="params[<?php echo $modifydate; ?>]" class="inputbox">
	<option value="" <?php if($values[$modifydate]==''){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_default; ?></option>
	<option value="0" <?php if($values[$modifydate]=='0'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_no; ?></option>

	<option value="1" <?php if($values[$modifydate]=='1'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_yes; ?></option>
</select>
</td>
</tr>
<?php
//show navigation option and icon-option only in joomla 1.5
if( defined('_JEXEC') ){
//joomla 1.5
?>
<tr <?php if(!$class_pi->check_display_page_property('page_props_showitemnavigation',164)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_showitemnavigation_tip; ?>', CAPTION, '<?php echo _pi_lang_showitemnavigation; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_showitemnavigation; ?></span></span>
</td>
<td>
<select name="params[show_item_navigation]" class="inputbox">
	<option value="" <?php if($values['show_item_navigation']==''){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_default; ?></option>
	<option value="0" <?php if($values['show_item_navigation']=='0'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_no; ?></option>

	<option value="1" <?php if($values['show_item_navigation']=='1'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_yes; ?></option>
</select>
</td>
</tr>
<tr <?php if(!$class_pi->check_display_page_property('page_props_show_icons',165)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_show_icons_tip; ?>', CAPTION, '<?php echo _pi_lang_show_icons; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_show_icons; ?></span></span>
</td>
<td>
<select name="params[show_icons]" class="inputbox">
	<option value="" <?php if($values['show_icons']==''){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_default; ?></option>
	<option value="0" <?php if($values['show_icons']=='0'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_no; ?></option>
	<option value="1" <?php if($values['show_icons']=='1'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_yes; ?></option>
</select>
</td>
</tr>
<?php
}//end show navigation option and icon-option only in joomla 1.5
?>
<tr <?php if(!$class_pi->check_display_page_property('page_props_pdf_link',166)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_pdf_tip; ?>', CAPTION, '<?php echo _pi_lang_pdf; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_pdf; ?></span></span>
</td>
<td>
<select name="params[<?php echo $pdf; ?>]" class="inputbox">
	<option value="" <?php if($values[$pdf]==''){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_default; ?></option>
	<option value="0" <?php if($values[$pdf]=='0'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_no; ?></option>

	<option value="1" <?php if($values[$pdf]=='1'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_yes; ?></option>
</select>
</td>
</tr>
<tr <?php if(!$class_pi->check_display_page_property('page_props_print',167)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_print_tip; ?>', CAPTION, '<?php echo _pi_lang_print; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_print; ?></span></span></td>
<td>
<select name="params[<?php echo $print; ?>]" class="inputbox">
	<option value="" <?php if($values[$print]==''){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_default; ?></option>
	<option value="0" <?php if($values[$print]=='0'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_no; ?></option>

	<option value="1" <?php if($values[$print]=='1'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_yes; ?></option>
</select>
</td>
</tr>
<tr <?php if(!$class_pi->check_display_page_property('page_props_mail_link',168)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_emaillink_tip; ?>', CAPTION, '<?php echo _pi_lang_emaillink; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_emaillink; ?></span></span></td>
<td>
<select name="params[<?php echo $email; ?>]" class="inputbox">
	<option value="" <?php if($values[$email]==''){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_default; ?></option>
	<option value="0" <?php if($values[$email]=='0'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_no; ?></option>

	<option value="1" <?php if($values[$email]=='1'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_yes; ?></option>
</select>
</td>
</tr>
<?php
//show hits-option, feed_summary only in joomla 1.5
if( defined('_JEXEC') ){
//joomla 1.5
?>
<tr <?php if(!$class_pi->check_display_page_property('page_props_showhits',169)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_showhits_tip; ?>', CAPTION, '<?php echo _pi_lang_showhits; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_showhits; ?></span></span>
</td>
<td>
<select name="params[show_hits]" class="inputbox">
	<option value="" <?php if($values['show_hits']==''){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_default; ?></option>
	<option value="0" <?php if($values['show_hits']=='0'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_no; ?></option>
	<option value="1" <?php if($values['show_hits']=='1'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_yes; ?></option>
</select>
</td>
</tr>
<tr <?php if(!$class_pi->check_display_page_property('page_props_feedsummary',170)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_feedsummary_tip; ?>', CAPTION, '<?php echo _pi_lang_feedsummary; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_feedsummary; ?></span></span>
</td>
<td>
<select name="params[feed_summary]" class="inputbox">	
	<option value="0" <?php if($values['feed_summary']=='0'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_intro; ?></option>
	<option value="1" <?php if($values['feed_summary']=='1'){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_full; ?></option>
	<option value="" <?php if($values['feed_summary']==''){ echo "selected=\"selected\""; }?>><?php echo _pi_lang_default; ?></option>
</select>
</td>
</tr>
<?php
}//end show hits-option, feed_summary only in joomla 1.5
?>
<tr <?php if(!$class_pi->check_display_page_property('page_props_suffix',171)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_suffix_tip; ?>', CAPTION, '<?php echo _pi_lang_suffix; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_suffix; ?></span></span></td>
<td><input type="text" name="params[pageclass_sfx]" value="<?php echo $values['pageclass_sfx']; ?>" class="text_area" size="20"/></td>
</tr>
<?php
		//show secure-option only for joomla 1.5
		if( defined('_JEXEC') ){
			//joomla 1.5
?>
<tr <?php if(!$class_pi->check_display_page_property('page_props_secure',172)){echo 'class="display_none"'; } ?>>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_secure_tip; ?>', CAPTION, '<?php echo _pi_lang_secure; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_secure; ?></span></span>
</td>
<td>
	<label><input type="radio" class="radio" name="params[secure]" value="-1" <?php if($values['secure']==-1){ echo "checked=\"checked\""; }?> /><?php echo _pi_lang_no; ?></label>
	<label><input type="radio" class="radio" name="params[secure]" value="0" <?php if($values['secure']==0){ echo "checked=\"checked\""; }?>  /><?php echo _pi_lang_ignore; ?></label>
	<label><input type="radio" class="radio" name="params[secure]" value="1" <?php if($values['secure']==1){ echo "checked=\"checked\""; }?> /><?php echo _pi_lang_yes; ?></label>	
</td>
</tr>
<?php
		//end if show secure-option only for joomla 1.5
		//show unpublished items to 'publisher'-usergroup only for joomla 1.0.x
		}else{
			//joomla 1.0.x
?>

<tr>
<td width="30%" >
<span class="editlinktip">
<span onMouseOver="return overlib('<?php echo _pi_lang_unpublisheditems_tip; ?>', CAPTION, '<?php echo _pi_lang_unpublisheditems; ?>', BELOW, RIGHT);" onMouseOut="return nd();" ><?php echo _pi_lang_unpublisheditems; ?></span></span>
</td>
<td>
	<label><input type="radio" class="radio" name="params[unpublished]" value="0" <?php if($values['unpublished']==0){ echo "checked=\"checked\""; }?> /><?php echo _pi_lang_hide; ?></label>
	<label><input type="radio" class="radio" name="params[unpublished]" value="1" <?php if($values['unpublished']==1){ echo "checked=\"checked\""; }?>  /><?php echo _pi_lang_show; ?></label>
</td>
</tr>


<?php 
		}//end if joomla 1.0.x (show unpublished items to 'publisher'-usergroup only for joomla 1.0.x)
		
		//hidden field for joomla 1.5 to say there are no menu-images
		if( defined('_JEXEC') ){
			//joomla 1.5
			echo '<input type="hidden" name="params[menu_image]" value="-1" />';
		}
	
	//only when edit page show cat_id and section_id
	if($sub_task=='edit'){		
		echo '<tr';
		if(!$class_pi->check_display_page_property('page_props_catid',176)){echo ' class="display_none"'; }
		echo '>';
			echo '<td>';			
				echo _pi_lang_category_id;
			echo '</td>';
			echo '<td>';			
				echo $cat_id;
			echo '</td>';
		echo '</tr>';
		echo '<tr';
		if(!$class_pi->check_display_page_property('page_props_sectionid',177)){echo ' class="display_none"'; }
		echo '>';
			echo '<td>';			
				echo _pi_lang_section_id;
			echo '</td>';
			echo '<td>';			
				echo $section_id;
			echo '</td>';
		echo '</tr>';
	}
		
	}//end if content page (content category blog) 
	
//only when edit page show page_id
if($sub_task=='edit'){
	echo '<tr';
		if(!$class_pi->check_display_page_property('page_props_menuid',178)){echo ' class="display_none"'; }
		echo '>';
		echo '<td>';
			echo _pi_lang_menu_id;			
		echo '</td>';
		echo '<td>';
			echo $pageId;			
		echo '</td>';
	echo '</tr>';	
}
	
	
?>

</table>
  </td>
  </tr>
</table>
</form>
	</td>
  </tr>
</table>
<?php
	$class_pi->display_footer();
?>	
	